{if $Think.get.op}
{else/}
</div>
{/if}
</div>

	
</div>
<script src="{$static_dir}/assets/js/iscroll.js"></script>
<script src="{$static_dir}/assets/js/usecar.js"></script>
<script src="{$static_dir}/assets/js/new_pages.js"></script>
<script src="{$static_dir}/assets/js/formSelects/formSelects-v4.js"></script>

<script>
	layui.use(['layer','laydate','table','element','upload','form','tree','flow','rate','laytpl'], function(){ 
		 	 var layer = layui.layer
		 	 ,laydate = layui.laydate
		 	 ,element = layui.element
		 	 ,laypage = layui.laypage
		 	 ,table = layui.table
			 ,upload = layui.upload
			 ,form = layui.form
			 ,formSelects = layui.formSelects
 			 ,flow = layui.flow
			 ,rate = layui.rate
			 ,laytpl = layui.laytpl;
			console.log(6666)
			 //保存最后登录的页面
	$.cookie("lastpath",window.location.href,{path:'/'});
	//判断是否存在用户
	if($.cookie('user')){
		var login_user=JSON.parse($.cookie('user'))
		$('.user_name').html(login_user.user_name)
	}else{
		Err('登录超时，请重新登录')
		window.location.href='{:url("/html/login/index")}'
	}
	var domain=  '{$setting.api_host}';
	var domain1='{$setting.api_redirect}';
	$('img').each(function(){
		if($(this).data('key')||$(this).data('name')){
			$(this).attr('src','http://new.jjcxfw.com/assets/img/noimg.gif')
		}
	})
	
	//11.判断地图起点（切换晋江和江西的，假数据用的），临时添加的，
	if($.cookie('area')){

	}else{
		$.cookie("area",'1',{path:'/'});
	}
	let qd;
	if($.cookie("area")==2){
		 qd = [118.57, 24.82]; //地图起点
    }else{
         qd = [115.860471,28.666866]; //地图起点
    }
	//11.完
	
	
	// $(`.layui-nav-item a[href='${urlname}']`).closest('.layui-nav-item').addClass('layui-nav-itemed')
	
	var api=getapi(domain)
	var path=geturl(domain1)
	//菜单列表
	var menuload=Load()

		var host= window.location.host //获取当前域名
		var href= window.location.href //获取当前地址
		var urlname=href.split(host)[1].split('?')[0]
		var urlname1=''
		let urlarr=urlname.split('/');
		
		urlarr[urlarr.length-1]=urlarr[urlarr.length-1].split('.')[0]
		urlarr[urlarr.length-1]=urlarr[urlarr.length-1].split('_')[0]
		console.log(urlarr)
		for(var url_i=0;url_i<urlarr.length;url_i++){
			console.log(urlarr[url_i])
			if(urlarr[url_i]==''){
				
			}else{
				urlname1+=('/'+urlarr[url_i])
			}
			
		}
		urlname1=urlname1+'.html'
		console.log(urlname1)
	//	urlname=urlname1
		//layui-nav-itemed
		console.log($(`.layui-nav-item a[href='${urlname}']`))
		$(`.layui-nav-item a[href='${urlname}']`).parents().each(function(){
		$(this).addClass('layui-nav-itemed')
	})
	$(`.layui-nav-item a[href='${urlname}']`).css('background','#1E9FFF')
		element.render()
		
	//请求面包屑
	ajax(api.config.whereform,{
		urlname:"/admin/models/index"
	}).done((res)=>{
		console.log(res)
	}).fail(()=>{
		
	})
	
	
	
	$(function(){
		
		
			   //自定义验证规则
			form.verify({
				remark: [/^[^<^>]{0,120}$/, '不得超过120个字符或包含非法字符'],
				age: function(value){
				if(value > 120 && value<0){
					return '请输入正确的年龄';
				}
				}
			});

			 $(".load_w").fadeOut(500,function(){
				 $(this).remove()
			 });

			 // 重置
			$('.reset').on('click',function(){
			    $(this).closest('form').find('input').each(function(){
					$(this).val("") 
			        $(this).attr('value','')
				})
			    $(this).closest('form').find('select').each(function(){
			        $(this).val("")
			        $(this).attr('value','')
			    })
			})
		 	  $('.back').on('click',function(){
		 	  	$.cookie("lastpath",'',{path:'/',expires: -1});
		 	  	console.log($.cookie("lastpath"))
		 	  	$.ajax({
		 	  		type:"post",
		 	  		beforeSend: function (xhr) {  
				       xhr.setRequestHeader("user-token", $.cookie('token'));  
				   	}, 
		 	  		url:api.login.out,
		 	  		data:{}
		 	  		,success:function(res){
		 	  			if(res.code==1){
							window.location.href='{:url("/html/login/index")}'
						}else if(res.code==102){
							Err(res.msg)
							window.location.href='{:url("/html/login/index")}'
						}else{
							Err(res.msg)
						}
		 	  		},
		 	  		error:function(){
		 	  			Err('请求失败')
		 	  		}
		 	  	});
		 	  	
		 	  	
		 	  })
			{include file="$JSFILE"}
		})
	})
</script>

</body>

</html>